package Server.ServerMainFrame.ServerMainFrameView;

import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;
import javax.swing.JScrollPane;
import java.awt.Component;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.UIManager;
import javax.swing.border.BevelBorder;

public class SitePane extends JPanel
{
    public SitePane()
    {
    	try
		{
		    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
    		
        scrollPane = new JScrollPane();
        scrollPane.setBorder(new BevelBorder(BevelBorder.LOWERED));
        table = new JTable(new SiteTableModel());
        table.setBounds(-200, -300, 300, 400);
        scrollPane.getViewport().add(table);
        
        table.setAutoResizeMode(JTable.AUTO_RESIZE_NEXT_COLUMN);
        table.setShowGrid(true);
        table.setEnabled(true);
        table.setDragEnabled(true);
        table.setSize(600, 700);
       
        this.add(this.scrollPane);
        this.setAutoscrolls(true);
    	this.setPreferredSize(new Dimension(600, 700));
    }
    
    private JScrollPane scrollPane;
    
    public JTable table;
}
class SiteTableModel extends AbstractTableModel
{
	public int getRowCount()
	{
	    return 10;
	}
	public int getColumnCount()
	{
		return 5;
	}
	public Object getValueAt(int row, int column)
	{
		return "";
	}
	public String getColumnName(int column)
	{
		return columnNames[column].toString();
	}
	
	private String columnNames[] = {"Site Number", "Site Name", "Password", "IP", "Port"};
}
